<!--
 * @Author: 码上talk|RC
 * @Date: 2021-08-04 17:34:56
 * @LastEditTime: 2021-09-07 02:52:09
 * @LastEditors: 码上talk|RC
 * @Description: 
 * @FilePath: /ma-portal/subpackage/default/pages/shop/@fragment/shop-card.vue
 * @微信:  13680065830
 * @邮箱:  3189482282@qq.com
 * @oops: Just do what I think it is right
-->
<template>
  <view :class="classes" @click="developing">
    <view class="name">{{ shop.name||'--' }}</view>
    <view class="time">开始时间：{{ shop.createTime }}</view>
    <image class="bg-img" :src="bgUrl" />
  </view>
</template>

<script>
export default {
  components: {},
  mixins: [],
  props: {
    shop: Object
  },
  data () {
    return {}
  },
  computed: {
    classes () {
      let classes = 'shop-card'
      if (this.shop && this.shop.isMain) {
        classes += ' shop-card--main'
      }
      return classes
    },
    bgUrl () {
      let url = 'background-image/my-shop.png'
      return this.$options.filters.prefixOssUrl(url)
    }
  },
  methods: {
    navToShopDetail (id) {
      this.nav(`/subpackage/shop/pages/detail/index?id=${id}`)
    }
  }
}
</script>

<style lang="less" scoped>
.shop-card {
  .flexLayout(@dir:column);
  padding: 40rpx 25rpx;
  position: relative;
  margin-top: 30rpx;
  width: 690rpx;
  height: 180rpx;
  box-sizing: border-box;
  .bg-img {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
  }
  .name {
    width: 650rpx;
    height: 100rpx;
    line-height: 37rpx;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 32rpx;
    color: #fff;
  }
  .time {
    margin-top: 28rpx;
    z-index: 1;
    color: #fff;
    font-size: 28rpx;
  }

  &:active {
    filter: brightness(0.8);
  }
}
</style>